package main

import (
	"github.com/zeromicro/go-zero/core/jsonx"
)

type RuleStr struct {
	Name string
	Age  int
}

func main() {
	ruleStr := "{\"name\": \"test\", \"age\":16}"
	ruleStrStruct := &RuleStr{}
	err := jsonx.UnmarshalFromString(ruleStr, ruleStrStruct)
	if err != nil {
		panic(err)
	}
}
